//
//  QKStatusViewModel.m
//  QKWeibo-OC
//
//  Created by iMac_Kurt on 16/9/1.
//  Copyright © 2016年 Kurt_Qi. All rights reserved.
//

#import "QKStatusViewModel.h"

@implementation QKStatusViewModel
// 头像地址
- (NSURL *)iconImageURL {
    return [NSURL URLWithString:self.status.user.profile_image_url];
}
// 会员等级图标
- (UIImage *)vipLevelIcon {
    NSUInteger rank = self.status.user.mbrank;
    NSString *imageName = [NSString stringWithFormat:@"common_icon_membership_level%lu", (unsigned long)rank];
    if (rank > 0 && rank < 7) {
        return [UIImage imageNamed:imageName];
    }
    return [UIImage imageNamed:@"common_icon_membership_expired"];
}
// 会员类型图标
// 认证类型  -1：没有人证 0：认证用户 2，3，5：企业认证 220：达人
- (UIImage *)menberTypeIcon {
    switch (self.status.user.verified_type) {
        case 0:
            return [UIImage imageNamed:@"avatar_vip"];
            break;
        case 2:
        case 3:
        case 5:
            return [UIImage imageNamed:@"avatar_enterprise_vip"];
            break;
        case 220:
            return [UIImage imageNamed:@"avatar_grassroot"];
            break;
        default:
            return nil;
            break;
    }
}
@end
